﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="csnid_wc_treelist" Namespace="Csnid.Web.UI.WebControls.TreeListView"
    TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <%--<script src="App_Common/JS/Z_DDDW.JS" type="text/javascript"></script>
    <script language=javascript type="text/javascript" >
    function ClickNode(img,isBottom,tableId)
{
    var imgId = img.src.substring(img.src.lastIndexOf("/")+1);
    var url = img.src.substring(0,img.src.lastIndexOf("/")+1);
    var oldTrId = img.parentElement.parentElement.id;
    var newTrId = oldTrId.substring(oldTrId.indexOf("_")+1);
    
    if( isBottom)
    {
        if( imgId == lExpend)
        {
            img.src =  url+ lPinch;
            img.parentElement.id = lPinch;
            PinchNode(newTrId,oldTrId,tableId);
        }
        else
        {
            img.src = url + lExpend;
            img.parentElement.id = lExpend;
            ExpendNode(newTrId,oldTrId,tableId);
        }   
    }
    else
    {
        if( imgId == tExpend )
        {
            img.src =  url+ tPinch;
            img.parentElement.id = tPinch;
            PinchNode(newTrId,oldTrId,tableId);
      
        }
        else
        {
            img.src = url + tExpend;
            img.parentElement.id = tExpend;
            ExpendNode(newTrId,oldTrId,tableId);
        }   
    }
}

function ExpendNode(newId,oldId,tableId)
{
    var tree = document.getElementById(tableId);
    for( var i = 0; i < tree.rows.length; i++ )
    {
        if( tree.rows[i].id.indexOf(newId) != -1 && tree.rows[i].id != oldId )
        {
            var isExpend = true;
            var pId = tree.rows[i].id;
           
            while( pId != oldId)
            {
                for( var j = 0; j < 2; j++ )
                    pId = pId.substring( 0,pId.lastIndexOf("/"));
                var parent = document.getElementById(pId);
                if( parent != null )
                {
                    var tempId = parent.cells[2].id;
                    if( tempId == lExpend || tempId == tExpend || tempId == "")
                        ;
                    else
                    {
                        isExpend = false;
                        break;
                    }
                }
                else
                    break;
            }
            if( isExpend )
               tree.rows[i].style.display="block";  
        }
    }
}

function PinchNode(newId,oldId,tableId)
{
    var tree = document.getElementById(tableId);
    for( var i = 0; i < tree.rows.length; i++ )
    {
        if( tree.rows[i].id.indexOf(newId) != -1 && tree.rows[i].id != oldId)
        {
            tree.rows[i].style.display = "none";
        }
    }
}

PawnShop.NameSpace();
PawnShop.Utility.AddProperty(PawnShop,"test","test");
    </script>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:TreeListView runat="server" ID="tlm" NodeColumnIndex="2" ParentKey="parentID"
                ColumnKey="ID" SortKey="Code" AutoGenerateColumns="false" ExpendDepth="1"
                EnableTheming="True" Width="100%" CssClass="zstTabGridStd" AllowPaging="True"
                BackColor="White" CellPadding="2" BorderWidth="1px" BorderStyle="Solid" BorderColor="#D6D3CE"
                AllowSorting="True" PageSize="20">
                <Columns>
                    <asp:LineNumberField HeaderStyle-Width="25" HeaderText="No.">
                    </asp:LineNumberField>
                    <asp:CheckBoxExField>
                    </asp:CheckBoxExField>
                    <asp:BoundField DataField="TypeName" HeaderText="Name" ItemStyle-Width="300" />
                    <asp:TemplateField >
                        <ItemTemplate>
                        <asp:CheckBoxList runat=server RepeatColumns=5>
                            <asp:ListItem Text=1 Value=1></asp:ListItem> 
                             <asp:ListItem Text=2 Value=2></asp:ListItem> 
                              <asp:ListItem Text=3 Value=3></asp:ListItem> 
                               <asp:ListItem Text=4 Value=4></asp:ListItem>
                                 <asp:ListItem Text=5 Value=5></asp:ListItem>  
                        </asp:CheckBoxList>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="TreeListView$Row$IsBottom" HeaderText="TreeListViewRowIsBottom" />
                    <asp:BoundField DataField="TreeListView$Row$IsLeaf" HeaderText="TreeListViewRowIsLeaf" />
                    <asp:BoundField DataField="TreeListView$Row$Depth" HeaderText="TreeListViewRowDepth" />
                </Columns>
                <AlternatingRowStyle CssClass="zstTabGridAlternate" />
                <RowStyle CssClass="zstTabGridAlternateItem" />
                <FooterStyle CssClass="zstTabGridFooter" />
                <HeaderStyle CssClass="zstTabGridHeader" />
                <EditRowStyle CssClass="zstTabGridRowSelect" />
                <SelectedRowStyle CssClass="zstTabGridRowSelect" />
            </asp:TreeListView>
        <asp:TreeView ID="TreeView1" runat="server">
            <Nodes>
                <asp:TreeNode Text="1" Value="1">
                    <asp:TreeNode Text="11" Value="11"></asp:TreeNode>
                    <asp:TreeNode Text="12" Value="12"></asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode Text="2" Value="2">
                    <asp:TreeNode Text="21" Value="21">
                        <asp:TreeNode Text="211" Value="211"></asp:TreeNode>
                    </asp:TreeNode>
                </asp:TreeNode>
            </Nodes>
        </asp:TreeView>
       
    </div>
    </form>
</body>
</html>
